home *** CD-ROM | disk | FTP | other *** search
- Path: access4.digex.net!not-for-mail
- From: ell@access4.digex.net (Ell)
- Newsgroups: comp.lang.c++
- Subject: Re: Pure Virtual Destructor Question
- Date: 9 Feb 1996 02:50:40 GMT
- Organization: The Universe
- Message-ID: <4fecq0$k4e@news4.digex.net>
- References: <4fas7a$7ns@comet2.magicnet.net>
- NNTP-Posting-Host: access4.digex.net
- X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
-
- Jody Hagins (gamecox@magicnet.magicnet.net) wrote:
- : Assume a class Foo s.t.
- :
- : class Foo
- : {
- : public:
- : virtual ~Foo() = 0;
- : };
- :
- : inline Foo::~Foo()
- : {
- : // do some destructor stuff
- : }
-
- Immediately above you are logically "defining" your "pure virtual"
- destructor "inside the class where it is "declared" as a pure virtual
- function. It is _illegal_ to logically, or physically "define" a pure
- virtual function in the class it is "declared" in. A pure virtual should
- only be defined in classes derived from the class where the pure virtual
- is declared. Only derived classes should "do some destructor stuff".
-
- Elliott
-